-
Notifications
You must be signed in to change notification settings - Fork 705
[BUG] Fix TimeSeriesDataSet
wrong inferred tensor
dtype
when time_idx
is included in features
#1950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1950 +/- ##
=======================================
Coverage ? 87.21%
=======================================
Files ? 142
Lines ? 8865
Branches ? 0
=======================================
Hits ? 7732
Misses ? 1133
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
elif isinstance(cols, list): # and len(cols) > 0 | ||
dtypekind = data.dtypes[cols[0]].kind | ||
# dtypekind = data.dtypes[cols[0]].kind | ||
dtypekind = data[cols].to_numpy().dtype.kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing this? It feels wasteful to do the conversion for the entire data container, instead of looking up the dtype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have a question about to_numpy
- should we not avoid conversion of the entire data to numpy
?
Good point. Would this be better?
|
Yes, I think this would avoid the memory leak, since we never read the values |
I just pushed this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, could you update the docstring?
done and pushed through |
TimeSeriesDataSet
wrong inferred tensor
dtype
when time_idx
is included in features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Reference Issues/PRs
Fixes #1930.
When
time_idx
or some other integer feature is included in the unknow reals, the dataset/dataloader elements are converted into the wrong dtype.What does this implement/fix? Explain your changes.
Modify the function the method
TimeSeriesDataSet._data_to_tensors._to_tensor()
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
Added test function to
tests/test_data/test_timeseries.py
Any other comments?
PR checklist